package com.cicadasmall.data.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cicadasmall.common.base.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.time.LocalDate;

/**
 * <p>
 * 基础账户表
 * </p>
 *
 * @author westboy
 * @date 2019-05-23
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@TableName("sys_user")
public class UserDO extends BaseDO {

    private static final long serialVersionUID = 1l;

    @TableId(value = "uid", type = IdType.AUTO)
    private Integer uid;

    private String email;

    private String phone;

    private String username;

    private String password;

    private Integer userType;

    private Integer status;

    private String createIp;

    private LocalDate lastLoginTime;

    private String lastLoginIp;

    private Integer loginNum;

    private Integer tenantId;

    private String realName;

    private String avatar;

    public Integer getLoginNum() {
        return loginNum == null ? 0 : loginNum;
    }

}
